CREATE TABLE [Model] (
  [id] INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, 
  [model] INT NOT NULL, 
  [m] INT NOT NULL, 
  [n] INT NOT NULL, 
  [e] FLOAT(53,0) NOT NULL, 
  [created] DATETIME NOT NULL DEFAULT (datetime('now','localtime')));

CREATE UNIQUE INDEX [Model_IX_Model] ON [Model] ([model] DESC);


CREATE TABLE [Data] (
  [id] INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, 
  [model] INT NOT NULL CONSTRAINT [FK_Data_Model] REFERENCES [Model]([model]), 
  [i] INT NOT NULL, 
  [j] INT NOT NULL DEFAULT (0), 
  [xij] FLOAT(53,0) NOT NULL DEFAULT (0), 
  [f] FLOAT(53,0) NOT NULL DEFAULT (0), 
  [created] DATETIME NOT NULL DEFAULT (datetime('now','localtime')));

CREATE INDEX [Data_IX_Data] ON [Data] ([model] DESC);


